using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace CubicFWNet.Data.Models.Mapping
{
    public class TechnologyMap : EntityTypeConfiguration<Technology>
    {
        public TechnologyMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            this.Property(t => t.Number)
                .HasMaxLength(64);

            this.Property(t => t.ProductName)
                .HasMaxLength(64);

            this.Property(t => t.HelpMemo)
                .HasMaxLength(512);

            this.Property(t => t.CreatorName)
                .HasMaxLength(64);

            this.Property(t => t.Memo)
                .HasMaxLength(256);

            // Table & Column Mappings
            this.ToTable("Technology");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.Number).HasColumnName("Number");
            this.Property(t => t.OrderProductId).HasColumnName("OrderProductId");
            this.Property(t => t.ProductName).HasColumnName("ProductName");
            this.Property(t => t.Materials).HasColumnName("Materials");
            this.Property(t => t.Data).HasColumnName("Data");
            this.Property(t => t.ApplyTime).HasColumnName("ApplyTime");
            this.Property(t => t.WorkersNum).HasColumnName("WorkersNum");
            this.Property(t => t.WorkLenth).HasColumnName("WorkLenth");
            this.Property(t => t.CheckLenth).HasColumnName("CheckLenth");
            this.Property(t => t.CheckNum).HasColumnName("CheckNum");
            this.Property(t => t.CreatorID).HasColumnName("CreatorID");
            this.Property(t => t.CreatorName).HasColumnName("CreatorName");
            this.Property(t => t.CreateTime).HasColumnName("CreateTime");
            this.Property(t => t.Status).HasColumnName("Status");
            this.Property(t => t.Memo).HasColumnName("Memo");
            this.Property(t => t.UserId).HasColumnName("UserId");
            this.Property(t => t.TechType).HasColumnName("TechType");
            this.Property(t => t.UseStatus).HasColumnName("UseStatus");
            this.Property(t => t.Amount).HasColumnName("Amount");
            this.Property(t => t.Ch).HasColumnName("Ch");
            this.Property(t => t.Cv).HasColumnName("Cv");
            this.Property(t => t.Tj).HasColumnName("Tj");
            this.Property(t => t.GiveH).HasColumnName("GiveH");
            this.Property(t => t.GiveW).HasColumnName("GiveW");
            this.Property(t => t.CarH).HasColumnName("CarH");
            this.Property(t => t.EquipmentType).HasColumnName("EquipmentType");
            this.Property(t => t.HelpMemo).HasColumnName("HelpMemo");
            this.Property(t => t.HelpMoney).HasColumnName("HelpMoney");
            this.Property(t => t.Tolerance).HasColumnName("Tolerance");
            this.Property(t => t.Space).HasColumnName("Space");
            this.Property(t => t.Margin).HasColumnName("Margin");
            this.Property(t => t.Distance).HasColumnName("Distance");
            this.Property(t => t.WasteHReal).HasColumnName("WasteHReal");
            this.Property(t => t.TechnologyMemo).HasColumnName("TechnologyMemo");
            this.Property(t => t.DistributeType).HasColumnName("DistributeType");
        }
    }
}
